import { RouteRecordRaw } from "vue-router";
import HomeView from "@/views/HomeView.vue";
import UserLayout from "@/layouts/UserLayout.vue";
import TestView from "@/views/TestView.vue";
import ManagerLayout from "@/layouts/ManagerLayout.vue";
import accessEnum from "@/access/accessEnum";
import NoAuth from "@/views/NoAuth.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "主页",
    component: HomeView,
  },
  {
    path: "/team",
    name: "队伍",
    component: HomeView,
  },
  {
    path: "/application",
    name: "应用",
    component: HomeView,
  },
  {
    path: "/recommend",
    name: "推荐",
    component: HomeView,
  },
  {
    path: "/noAuth",
    name: "无权限",
    component: NoAuth,
  },
  {
    path: "/user",
    name: "用户",
    component: UserLayout,
    meta: {
      access: accessEnum.ADMIN,
    },
    children: [
      {
        path: "login",
        name: "登录",
        component: HomeView,
      },
      {
        path: "register",
        name: "注册",
        component: HomeView,
      },
    ],
  },
  {
    path: "/admin",
    name: "管理员",
    component: ManagerLayout,
    meta: {
      access: accessEnum.ADMIN,
    },
    children: [
      {
        path: "userManager",
        name: "用户管理",
        component: HomeView,
      },
    ],
  },
];
